package dgut.haitaobao.controller;

import dgut.haitaobao.service.OrderService;
import dgut.haitaobao.util.response.HttpResponse;
import dgut.haitaobao.vo.param.AddOrderParamsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.HandlerInterceptor;

@RestController
@CrossOrigin
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    @RequestMapping("/addOrder")
    public HttpResponse addOrder(@RequestBody AddOrderParamsVO paramsVO){
        System.out.println(paramsVO);
       return orderService.addOrderByUserId(paramsVO);
    }
}
